package com.woniuxy.service.impl;

import com.woniuxy.entity.Nurse;
import com.woniuxy.mapper.NurseMapper;
import com.woniuxy.service.NurseService;
import com.woniuxy.service.SaasService;
import com.woniuxy.util.GetUserContent;
import com.woniuxy.util.ResponseData;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NurseServiceImpl implements NurseService, SaasService {
    @Autowired
    NurseMapper nurseMapper;
    @Override
    @SneakyThrows
    public ResponseData<?> queryNurse() {
        Long userId = (Long) GetUserContent.getUserInfo().get("userId");
        Nurse nurse = nurseMapper.queryNurse(Math.toIntExact(userId));
        return new ResponseData<>().ok(nurse);
    }
}
